#include "common.hpp"

int64_t phys::globTime;
double phys::G = 6.67384e-11;
double phys::ERR = 1e-9;
double phys::PI = 3.141592653589793238462643383279;

int screen::X = 1280;
int screen::Y = 720;
int screen::ORBITPCOUNT = 1500; // should be even
//double screen::SCALE = 1.5e6;
double screen::SCALE = 5e8;
//double screen::SCALE = 5e7;
double screen::DRADMIN = 5;
sf::Color screen::ORBITCOL  = sf::Color::Magenta;
sf::Color screen::STARCOL   = sf::Color::Yellow;
sf::Color screen::PLANETCOL = sf::Color::Green;
sf::Color screen::BLANKCOL  = sf::Color::Black;

unsigned char move_t::FIXED   = 0;
unsigned char move_t::ORBIT_E = 1;
unsigned char move_t::ORBIT_H = 2;

/* Takes input angle in radians, converts to degrees */
double radToDeg(double rad)
{
	return (rad*360/(2*phys::PI));
}

/* Takes input angle in degrees, converts to radians */
double degToRad(double deg)
{
	return (deg*(2*phys::PI)/360);
}

/* Computes log base b of x */
double logbase(double x, double b)
{
	return((log(x))/(log(b)));
}

int sgn(double x)
{
	return( (x > 0) - (x < 0) );
}

